<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="UserMessagesEditDlg" widgetVar="UserMessagesEditDialog" modal="true" resizable="false" appendToBody="true" header="#{bundle.EditUserMessagesTitle}">

            <h:form id="UserMessagesEditForm">

                <h:panelGroup id="display">
                    <p:panelGrid  columns="2" rendered="#{userMessagesController.selected != null}">

                        <h:outputLabel value="#{bundle.EditUserMessagesLabel_messageIdmessage}" for="messageIdmessage" />
                        <h:outputText id="messageIdmessage" value="#{userMessagesController.selected.messageIdmessage}" />

                        <p:outputLabel value="#{bundle.EditUserMessagesLabel_status}" for="status" />
                        <p:inputText id="status" value="#{userMessagesController.selected.status}" title="#{bundle.EditUserMessagesTitle_status}" required="true" requiredMessage="#{bundle.EditUserMessagesRequiredMessage_status}"/>

                        <p:outputLabel value="#{bundle.EditUserMessagesLabel_userid}" for="userid" />
                        <p:selectOneMenu id="userid" value="#{userMessagesController.selected.userid}" required="true" requiredMessage="#{bundle.EditUserMessagesRequiredMessage_userid}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{userController.items}"
                                           var="useridItem"
                                           itemValue="#{useridItem}"
                                           itemLabel="#{useridItem.id.toString()}"
                                           />
                            <f:converter binding="#{userConverter}"/>
                        </p:selectOneMenu>

                        <p:outputLabel value="#{bundle.EditUserMessagesLabel_message}" for="message" />
                        <p:selectOneMenu id="message" value="#{userMessagesController.selected.message}" required="true" requiredMessage="#{bundle.EditUserMessagesRequiredMessage_message}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{messageController.items}"
                                           var="messageItem"
                                           itemValue="#{messageItem}"
                                           itemLabel="#{messageItem.idMessage.toString()}"
                                           />
                            <f:converter binding="#{messageConverter}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{userMessagesController.save}" value="#{bundle.Save}" update="display,:UserMessagesListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,UserMessagesEditDialog);"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="UserMessagesEditDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
